PHASE9: Find Shortest Path between Objective Rivers

PHASE9: Find Shortest Path between Objective Rivers

Summary
PHASE8 has created hundreds of thousands of way-to-way solutions between .Objective Rivers -- by taking each point on the source river at 150m distance and finding cost-effective path to destination river.
In this phase, the most cost-effective paths are identified among thousands and published routed-solution in different resolutions for sharing, publishing, and planning.

STEP1: Preview shortest paths
NOTE: This step is merely for information gathering and analysis

Get nodeIds for start and end nodes for some point-of-interests:

Get node-id at Ganga River near Binjor (NH34): 29.3713, 78.0392

${PCH_APP_HOME}/run_CostBasedGridGraphGenerator.sh --action getNodeIdForLatLon --lat=29.3713 --lon=78.0392 --useConfigFromDB true --costspec ${G2K_DATA_HOME}/simple_cost_spec_by_db.json

<<Returns: 1666663341>>
For reverse-lookup (getting lon/lat for given node-id):
${PCH_APP_HOME}/run_CostBasedGridGraphGenerator.sh --action getLatLonForNodeId --useConfigFromDB true --costspec ${G2K_DATA_HOME}/simple_cost_spec_by_db.json --paginationspec ${G2K_DATA_HOME}/runtime_cost_spec_by_db.json --nodeId=71096541

STEP2: Get top-5 river-to-river paths
This step collects coors of most cost-effective path that get used in next step in saving the top-3 routes

vi ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh

SRC_WAY_TITLE='Ganga River'
SRC_WAY_SUB_TITLE='From Himalya to Bay of Bengal'
DST_WAY_TITLE='Kaveri River'
DST_WAY_SUB_TITLE='Talakaveri to Kaveripattinam'
SRC_WAY_TITLE='Ganga River'
SRC_WAY_SUB_TITLE='From Himalya to Bay of Bengal'
DST_WAY_TITLE='Kaveri River'
DST_WAY_SUB_TITLE='Talakaveri to Kaveripattinam'

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --topNCount 25

Ganga - to - Kaveri:
solutionId edgeCost distance srcWayPtId dstWayPtId srcWayPt dstWayPt
86725 21180210 3622.25948 12252 15510 (81.21661,25.90045) (77.27215,12.31206) <-----
86739 21180247 3622.26978 12253 15510 (81.21681,25.89921) (77.27215,12.31206)
86733 21180959 3622.46749 12255 15510 (81.21710,25.89674) (77.27215,12.31206)
86729 21183586 3622.90551 12247 15510 (81.21536,25.90656) (77.27215,12.31206)
86540 21185626 3623.52271 12157 15506 (81.13932,25.96630) (77.26749,12.31383)
86530 21185760 3623.56003 12150 15510 (81.13059,25.96640) (77.27215,12.31206)
86528 21186435 3623.74767 12149 15512 (81.12935,25.96656) (77.27442,12.31103) <-----
86499 21186706 3623.82290 12144 15510 (81.12333,25.96819) (77.27215,12.31206)
86505 21188168 3624.22879 12141 15510 (81.12058,25.97057) (77.27215,12.31206)
86491 21188456 3624.30884 12140 15510 (81.12007,25.97171) (77.27215,12.31206)
86541 21190082 3624.76055 12161 15510 (81.14431,25.96646) (77.27215,12.31206)
86556 21190343 3624.83316 12165 15510 (81.14929,25.96689) (77.27215,12.31206)
86492 21191609 3625.18468 12133 15510 (81.11811,25.98022) (77.27215,12.31206)
86476 21194867 3626.08972 12125 15512 (81.11173,25.98753) (77.27442,12.31103)
86465 21196316 3626.49229 12117 15512 (81.10202,25.98767) (77.27442,12.31103)
86464 21196421 3626.52146 12119 15510 (81.10447,25.98817) (77.27215,12.31206)
86435 21197616 3626.85325 12113 15510 (81.09740,25.98918) (77.27215,12.31206)
86429 21200104 3627.54444 12108 15510 (81.09196,25.99213) (77.27215,12.31206)
86424 21202068 3628.08989 12102 15510 (81.08504,25.99498) (77.27215,12.31206)
86423 21202915 3628.32517 12101 15512 (81.08394,25.99557) (77.27442,12.31103)
86714 21205664 3626.85353 12237 15510 (81.21504,25.91887) (77.27215,12.31206)
86416 21206274 3629.25831 12093 15510 (81.07449,25.99866) (77.27215,12.31206)
86387 21206705 3629.37802 12091 15510 (81.07209,25.99934) (77.27215,12.31206)
86681 21207265 3627.29831 12230 15510 (81.21580,25.92757) (77.27215,12.31206)
86683 21207417 3627.34067 12229 15506 (81.21569,25.92881) (77.26749,12.31383)

STEP3: Save top-5 river-to-river paths as saved-solutions (populating: routing_solutions)
Based on cost-effective lat/lon coors found, this step routes through high-order2 node/edges and saves the full cost/distance/geometric details.

NOTE: saved-solutions in routing_solutions table are published as layer to routing services

Config Params:
onTheFlyDistanceCapKm of 30 means, the end point of 30km long will be linked automatically

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-1_Ganga-to-Kaveri_Route"
--fromlon=81.21661 --fromlat=25.90045 --tolon=77.27215 --tolat=12.31206 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-2_Ganga-to-Kaveri_Route"
--fromlon=81.12935 --fromlat=25.96656 --tolon=77.27442 --tolat=12.31103 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

NOTE:
lat/lon coors are the most cost-effective ones found in previous step
Each search runs for about 200seconds

The result of saving top-3 cost-effective routes:
g2k_top3_ganga_to_kaveri_route.png
Ref: Ref: g2k_top3_ganga_to_kaveri_route.png

STEP5: River-to-river paths in different source Zones
Unlike previous steps that saved the most cost-effective routing paths for the entire source and destination rivers,
this step would save cost-effective routing paths for each of four zones of source river.
The entire path of source river is broken into four zones and cost-effective routing path is found in each zone.

way_geometry_points geo range:
WITH max_way_pt AS (
SELECT way_id AS max_way_id, MAX(sub_index) AS max_sub_index FROM way_geometry_points GROUP BY way_id
), min_way_pt AS (
SELECT way_id AS min_way_id, MIN(sub_index) AS min_sub_index FROM way_geometry_points GROUP BY way_id
), max_way_geom AS (
SELECT mwaypts.max_way_id AS max_way_id, way_geom.title, way_geom.subtitle, ST_AsText(waypts.way_pt) AS max_way_geom
FROM way_geometry_points AS waypts, max_way_pt AS mwaypts, way_geometry AS way_geom
WHERE 1=1
AND waypts.way_id=mwaypts.max_way_id
AND way_geom.way_id=mwaypts.max_way_id
AND waypts.sub_index= mwaypts.max_sub_index
), min_way_geom AS (
SELECT mwaypts.min_way_id AS min_way_id, way_geom.title, way_geom.subtitle, ST_AsText(waypts.way_pt) AS min_way_geom
FROM way_geometry_points AS waypts, min_way_pt AS mwaypts, way_geometry AS way_geom
WHERE 1=1
AND waypts.way_id=mwaypts.min_way_id
AND way_geom.way_id=mwaypts.min_way_id
AND waypts.sub_index= mwaypts.min_sub_index
)
SELECT max_way_geom.title, max_way_geom.subtitle, min_way_geom AS min_geom, max_way_geom AS max_geom
FROM min_way_geom, max_way_geom
WHERE 1=1
AND min_way_geom.min_way_id=max_way_geom.max_way_id
ORDER BY max_way_geom.title, max_way_geom.subtitle, min_way_geom;

 title      |              subtitle               |                  min_geom                   |                  max_geom

----------------+-------------------------------------+---------------------------------------------+---------------------------------------------
Ganga River | From Himalya to Bay of Bengal | POINT(79.21567865704891 27.719020357775033) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(79.26204752679182 27.715603594940344) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(79.3336414834505 27.652800981836243) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(79.43530515501168 27.61201194855668) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(79.48871159516717 27.550790634993465) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(79.94094665682007 27.13824224525629) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.00410178638295 26.994280910372602) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.14484075817042 26.777668027597183) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.18143759984576 26.69319567672943) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.22820699937817 26.69207593532038) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.25703769098595 26.68919859142054) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.27772428497609 26.602461370236437) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(80.48585822752658 26.392366510245704) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(81.43682687436103 25.658182013310032) | POINT(81.4957846296158 25.62184088748077)
Ganga River | From Himalya to Bay of Bengal | POINT(81.91803454919362 25.385748309792113) | POINT(81.4957846296158 25.62184088748077)
Kaveri River | Talakaveri to Kaveripattinam | POINT(75.53477855507589 12.384703979381875) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(75.90441762666318 12.372352967662225) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(75.91141255660128 12.408264082714123) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(75.91184380051271 12.390438898246453) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(76.595481387483 12.416053034743411) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(76.67089807917306 12.425879891583087) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(76.72336523590667 12.405546502626954) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(77.16835900396386 12.257632449077496) | POINT(79.78100248341013 11.149463442774834)
Kaveri River | Talakaveri to Kaveripattinam | POINT(79.78274542291275 11.149620654355438) | POINT(79.78100248341013 11.149463442774834)

NOTE: Rivers can have multiple rows -- since geometries might have multiple segments

Four lon range-zones per each river:
Title Zone-1 Zone-2 Zone-3 Zone-4 Notes
Ganga River 79.21567-79.7856985 79.7856985-80.355727 80.355727-80.9257555 80.9257555-81.495784 81.495784-79.21567=2.280114/4=0.5700285
Yamuna River 77.70005-78.7478587 78.7478587-79.795667 79.795667-80.8434762 80.8434762-81.891285 81.891285-77.70005=4.191235/4=1.04780875
Narmada River 75.00099-76.691635 76.691635-78.38228 78.38228-80.072925 80.072925-81.76357 81.76357-75.00099=6.76258/4=1.690645
Godavari River 75.00114-76.7508325 76.7508325-78.500525 78.500525-80.2502175 80.2502175-81.99991 81.99991-75.00114=6.99877/4=1.7496925
Krishna River 75.15523-76.64966 76.64966-78.14409 78.14409-79.63852 79.63852-81.13295 81.13295-75.15523=5.97772/4=1.49443
Kaveri River 75.53477-76.5963275 76.5963275-77.657885 77.657885-78.7194425 78.7194425-79.781 79.78100-75.53477=4.24623/4=1.0615575
Beas River 75.05453-75.17918 75.17918-75.30383 75.30383-75.42848 75.42848-75.55313 75.55313-75.05453=0.4986/4=0.12465
Ravi River 74.50030-74.58293 74.58293-74.66556 74.66556-74.74819 74.74819-74.83083 74.83083-74.50030=0.33053/4=0.08263
Sutlej River 74.01213-74.75906 74.75906-75.50599 75.50599-76.25292 76.25292-76.99986 76.99986-74.01213=2.98773/4=0.74693

Way-to-way solutions in four-zones for each river:

Same as before, we will find the cost-effective source and destination coors; but localized to different zones. Also, we will pick only the top-1 cost-effective routes.

For Ganga-to-Kaveri:
vi ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh

SRC_WAY_TITLE="Ganga River"
SRC_WAY_SUB_TITLE="From Himalya to Bay of Bengal"
DST_WAY_TITLE="Kaveri River"
DST_WAY_SUB_TITLE="Talakaveri to Kaveripattinam"
SRC_WAY_TITLE="Ganga River"
SRC_WAY_SUB_TITLE="From Himalya to Bay of Bengal"
DST_WAY_TITLE="Kaveri River"
DST_WAY_SUB_TITLE="Talakaveri to Kaveripattinam"

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --useOnlyLons true --fromlon=79.21567 --tolon=79.7856985
--topNCount 10 --nearbyPoints 250

solutionId edgeCost distance srcWayPtId dstWayPtId srcWayPt dstWayPt
114181 22656005 3888.99532 10389 14020 (79.77041,27.19553) (76.41617,12.53117) <-------
114203 22656690 3889.18563 10397 14020 (79.77955,27.19183) (76.41617,12.53117)
114182 22659027 3889.83473 10389 14003 (79.77041,27.19553) (76.43363,12.52518)

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --useOnlyLons true --fromlon=79.7856985 --tolon=80.355727
--topNCount 10 --nearbyPoints 250
solutionId edgeCost distance srcWayPtId dstWayPtId srcWayPt dstWayPt
116002 21258284 3638.69144 11181 15510 (80.30073,26.57082) (77.27215,12.31206) <-------
116012 21258857 3638.85084 11189 15510 (80.30182,26.56088) (77.27215,12.31206)
116036 21259023 3638.89689 11205 15506 (80.30612,26.54159) (77.26749,12.31383)

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --useOnlyLons true --fromlon=80.355727 --tolon=80.9257555
--topNCount 10 --nearbyPoints 250
solutionId edgeCost distance srcWayPtId dstWayPtId srcWayPt dstWayPt
116541 21220485 3628.21729 11528 15498 (80.56958,26.27403) (77.25778,12.31224) <-------
116556 21224830 3629.42426 11533 15512 (80.57431,26.26997) (77.27442,12.31103)
116975 21242448 3635.10484 11853 15512 (80.83687,26.02013) (77.27442,12.31103)

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --useOnlyLons true --fromlon=80.9257555 --tolon=81.495784
--topNCount 10 --nearbyPoints 250
solutionId edgeCost distance srcWayPtId dstWayPtId srcWayPt dstWayPt
117518 21180210 3622.25948 12252 15510 (81.21661,25.90045) (77.27215,12.31206) <-------
117534 21180247 3622.26978 12253 15510 (81.21681,25.89921) (77.27215,12.31206)
117533 21180959 3622.46749 12255 15510 (81.21710,25.89674) (77.27215,12.31206)

Save the srcWayPt-to-dstWayPt solutions for each zones:

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-1_Ganga-to-Kaveri_Route"
--fromlon=79.77041 --fromlat=27.19553 --tolon=76.41617 --tolat=12.53117 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>1 &
nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-2_Ganga-to-Kaveri_Route"
--fromlon=80.30073 --fromlat=26.57082 --tolon=77.27215 --tolat=12.31206 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>1 &
nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-3_Ganga-to-Kaveri_Route"
--fromlon=80.56958 --fromlat=26.27403 --tolon=77.25778 --tolat=12.31224 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>1 &
nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-4_Ganga-to-Kaveri_Route"
--fromlon=81.21661 --fromlat=25.90045 --tolon=77.27215 --tolat=12.31206 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>1 &

The result of saving zone-to-zone paths with top-3 cost-effective routes:
g2k_ganga_to_kaveri_route_0401026.png
Ref: g2k_ganga_to_kaveri_route_0401026.png

STEP8: On-Demand Top-3 Routes
Telugu-Ganga Project:
Kandaleru Reservoir: Source of Telugu-Ganga Kandaleru-Poondi Canal
Poondi Reservoir: Destination of Telugu-Ganga Kandaleru-Poondi Canal

WITH point_counts AS (
SELECT src_geom.title, src_geom.subtitle, COUNT(src.way_pt_id) AS total_points
FROM way_geometry_points AS src, way_geometry AS src_geom
WHERE src.way_id=src_geom.way_id
GROUP BY src_geom.title, src_geom.subtitle
)
SELECT title, subtitle, total_points, CEIL((CEIL(total_points/100.0)*10000)/800)*800 AS points_to_search
FROM point_counts;

----------------+----------------------------------------------+--------------+------------------
Kandaleru Reservoir | Source of Telugu-Ganga Kandaleru-Poondi Canal      |         1467 |           150400
Poondi Reservoir    | Destination of Telugu-Ganga Kandaleru-Poondi Canal |          681 |            70400
----------------+----------------------------------------------+--------------+------------------
Kandaleru Reservoir | Source of Telugu-Ganga Kandaleru-Poondi Canal      |         1467 |           150400
Poondi Reservoir    | Destination of Telugu-Ganga Kandaleru-Poondi Canal |          681 |            70400

vi ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh

SRC_WAY_TITLE='Kandaleru Reservoir'
SRC_WAY_SUB_TITLE='Source of Telugu-Ganga Kandaleru-Poondi Canal'
DST_WAY_TITLE='Poondi Reservoir'
DST_WAY_SUB_TITLE='Destination of Telugu-Ganga Kandaleru-Poondi Canal'
SRC_WAY_TITLE='Kandaleru Reservoir'
SRC_WAY_SUB_TITLE='Source of Telugu-Ganga Kandaleru-Poondi Canal'
DST_WAY_TITLE='Poondi Reservoir'
DST_WAY_SUB_TITLE='Destination of Telugu-Ganga Kandaleru-Poondi Canal'

nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayBuildSolutions --rowBeginAt=0 --rowEndAt=150400 --useOnlyTitles true --yesIReallyWantToDo true > $PCH_LOG_HOME/nohup.out 2>&1 &

${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayToWayFetchTopNSolutions --topNCount 25

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-1_Kandaleru-to-Poondi_Route"
--fromlon=81.92057 --fromlat=25.35021 --tolon=77.65553 --tolat=12.19950 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-2_Kandaleru-to-Poondi_Route"
--fromlon=81.99071 --fromlat=25.32188 --tolon=77.69747 --tolat=12.18556 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-3_Kandaleru-to-Poondi_Route"
--fromlon=81.95155 --fromlat=25.32702 --tolon=77.69630 --tolat=12.18599 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

HMWSSB_Krishna-to-Hyderabad Project:
Ref:
https://docsbay.net/doc/343871/hyderabad-metropolitan-water-supply-sewerage-board
The treated water is being pumped by three pumping stations viz.,
Kodandapur (KM 116/0 -- 16.0973, 77.8992), Nasarlapally (KM 82/2 -- 16.8075, 78.8568) and Godakondla (KM 59/6 -- 16.96309, 78.73228 (or 16.80010, 78.81909) on the Hyderabad - Nagarjunasagar State Highway -2 to Master Balance reservoirs at Gungal(KM 40).
From Gungal (17.10983, 78.67597) the water flows by gravity to Sahebnagar Terminal Balancing Reservoir (KM 10 -- 17.317097, 78.555862) and then distributed in to the distribution network of Hyderabad and Secunderabad.
HMWSSB Sahebnagar Reservoir Campus: https://www.openstreetmap.org/way/557829508

Source Rectangle Coors of Krishna River: (77.52,15.75), (77.52,16.80), (79.55,16.80), (79.55,15.75)
Dest Coor of Sahebnagar Terminal Balancing Reservoir: 17.317097, 78.555862

vi ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh

SRC_WAY_TITLE='Krishna River'
SRC_WAY_SUB_TITLE='From Mahabaleshwar to Machilipatnam'
DST_WAY_TITLE='Kaveri River'
DST_WAY_SUB_TITLE='Talakaveri to Kaveripattinam'
SRC_WAY_TITLE='Krishna River'
SRC_WAY_SUB_TITLE='From Mahabaleshwar to Machilipatnam'
DST_WAY_TITLE='Kaveri River'
DST_WAY_SUB_TITLE='Talakaveri to Kaveripattinam'

NOTE:
SRC_WAY_TITLE/SRC_WAY_SUB_TITLE is the source water-way of HMWSSB project
"wayPtsToPtsBuildTopNSolutions" action ignores the DST_WAY_TITLE/DST_WAY_SUB_TITLE

nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayPtsToPtsBuildTopNSolutions --useOnlyTitles true --yesIReallyWantToDo true
--fromlon=77.52,77.52,79.55,79.55 --fromlat=15.75,16.80,16.80,15.75 --tolon=78.555862 --tolat=17.317097 --topNCount 25 > $PCH_LOG_HOME/nohup.out 2>&1 &

Status  FromPt  		ToPt    		Cost    Distance
VALID   (79.2533,16.5740)       (78.5559,17.3171)       1639751 156.38952	<-------
VALID   (79.2526,16.5733)       (78.5559,17.3171)       1639751 156.38952
VALID   (79.2545,16.5744)       (78.5559,17.3171)       1639996 156.45752
VALID   (79.2557,16.5747)       (78.5559,17.3171)       1639996 156.45752
VALID   (79.2524,16.5720)       (78.5559,17.3171)       1640201 156.51458
VALID   (79.2569,16.5751)       (78.5559,17.3171)       1640289 156.43026
VALID   (79.2581,16.5754)       (78.5559,17.3171)       1640769 156.56352
VALID   (79.2593,16.5758)       (78.5559,17.3171)       1640972 156.62008
VALID   (79.2523,16.5708)       (78.5559,17.3171)       1641073 156.75668
VALID   (79.2521,16.5696)       (78.5559,17.3171)       1641149 156.77791
VALID   (79.2519,16.5683)       (78.5559,17.3171)       1641149 156.77791
VALID   (79.2617,16.5765)       (78.5559,17.3171)       1641348 156.72449
VALID   (79.2605,16.5761)       (78.5559,17.3171)       1641348 156.72449
VALID   (79.2641,16.5772)       (78.5559,17.3171)       1641634 156.80383	<-------
VALID   (79.2629,16.5768)       (78.5559,17.3171)       1641634 156.80383
VALID   (79.2518,16.5671)       (78.5559,17.3171)       1642218 157.07487
VALID   (79.2516,16.5658)       (78.5559,17.3171)       1642218 157.07487
VALID   (79.2653,16.5775)       (78.5559,17.3171)       1642380 157.01121
VALID   (79.2665,16.5779)       (78.5559,17.3171)       1642380 157.01121
VALID   (79.2677,16.5782)       (78.5559,17.3171)       1642509 157.04696
VALID   (79.2689,16.5786)       (78.5559,17.3171)       1642673 157.09259	<-------
VALID   (79.2515,16.5646)       (78.5559,17.3171)       1642730 157.21687
VALID   (79.2511,16.5621)       (78.5559,17.3171)       1643550 157.44468
VALID   (79.2513,16.5634)       (78.5559,17.3171)       1643550 157.44468
VALID   (79.2510,16.5609)       (78.5559,17.3171)       1645384 157.78355
Status  FromPt  		ToPt    		Cost    Distance
VALID   (79.2533,16.5740)       (78.5559,17.3171)       1639751 156.38952	<-------
VALID   (79.2526,16.5733)       (78.5559,17.3171)       1639751 156.38952
VALID   (79.2545,16.5744)       (78.5559,17.3171)       1639996 156.45752
VALID   (79.2557,16.5747)       (78.5559,17.3171)       1639996 156.45752
VALID   (79.2524,16.5720)       (78.5559,17.3171)       1640201 156.51458
VALID   (79.2569,16.5751)       (78.5559,17.3171)       1640289 156.43026
VALID   (79.2581,16.5754)       (78.5559,17.3171)       1640769 156.56352
VALID   (79.2593,16.5758)       (78.5559,17.3171)       1640972 156.62008
VALID   (79.2523,16.5708)       (78.5559,17.3171)       1641073 156.75668
VALID   (79.2521,16.5696)       (78.5559,17.3171)       1641149 156.77791
VALID   (79.2519,16.5683)       (78.5559,17.3171)       1641149 156.77791
VALID   (79.2617,16.5765)       (78.5559,17.3171)       1641348 156.72449
VALID   (79.2605,16.5761)       (78.5559,17.3171)       1641348 156.72449
VALID   (79.2641,16.5772)       (78.5559,17.3171)       1641634 156.80383	<-------
VALID   (79.2629,16.5768)       (78.5559,17.3171)       1641634 156.80383
VALID   (79.2518,16.5671)       (78.5559,17.3171)       1642218 157.07487
VALID   (79.2516,16.5658)       (78.5559,17.3171)       1642218 157.07487
VALID   (79.2653,16.5775)       (78.5559,17.3171)       1642380 157.01121
VALID   (79.2665,16.5779)       (78.5559,17.3171)       1642380 157.01121
VALID   (79.2677,16.5782)       (78.5559,17.3171)       1642509 157.04696
VALID   (79.2689,16.5786)       (78.5559,17.3171)       1642673 157.09259	<-------
VALID   (79.2515,16.5646)       (78.5559,17.3171)       1642730 157.21687
VALID   (79.2511,16.5621)       (78.5559,17.3171)       1643550 157.44468
VALID   (79.2513,16.5634)       (78.5559,17.3171)       1643550 157.44468
VALID   (79.2510,16.5609)       (78.5559,17.3171)       1645384 157.78355

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-1_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=81.92057 --fromlat=25.35021 --tolon=77.65553 --tolat=12.19950 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-2_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=81.99071 --fromlat=25.32188 --tolon=77.69747 --tolat=12.18556 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Top-3_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=81.95155 --fromlat=25.32702 --tolon=77.69630 --tolat=12.18599 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

Zone-to-zone paths
Four lon range-zones within Krishna river segment:
Segment range: 79.55-77.52 = 2.03/4 = 0.5075
Zone-1: 77.52 - 78.0275
Zone-2: 78.0275 - 78.535
Zone-3: 78.535 - 79.0425
Zone-4: 79.0425 - 79.55 (Top-1 already pathed)

nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayPtsToPtsBuildTopNSolutions --useOnlyTitles true --yesIReallyWantToDo true
--fromlon=77.52,77.52,78.0275,78.0275 --fromlat=15.75,16.80,16.80,15.75 --tolon=78.555862 --tolat=17.317097 --topNCount 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

Status  FromPt  		ToPt    		Cost    Distance
VALID   (77.6505,16.3560)       (78.5559,17.3171)       1710718 176.09361	<-------
VALID   (77.6493,16.3561)       (78.5559,17.3171)       1710718 176.09361
VALID   (77.6480,16.3563)       (78.5559,17.3171)       1710718 176.09361
VALID   (77.6517,16.3558)       (78.5559,17.3171)       1710935 176.15372
VALID   (77.6542,16.3553)       (78.5559,17.3171)       1711101 176.19983
Status  FromPt  		ToPt    		Cost    Distance
VALID   (77.6505,16.3560)       (78.5559,17.3171)       1710718 176.09361	<-------
VALID   (77.6493,16.3561)       (78.5559,17.3171)       1710718 176.09361
VALID   (77.6480,16.3563)       (78.5559,17.3171)       1710718 176.09361
VALID   (77.6517,16.3558)       (78.5559,17.3171)       1710935 176.15372
VALID   (77.6542,16.3553)       (78.5559,17.3171)       1711101 176.19983

nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayPtsToPtsBuildTopNSolutions --useOnlyTitles true --yesIReallyWantToDo true
--fromlon=78.0275,78.0275,78.535,78.535 --fromlat=15.75,16.80,16.80,15.75 --tolon=78.555862 --tolat=17.317097 --topNCount 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

Status  FromPt  		ToPt    		Cost    Distance
VALID   (78.4819,16.0676)       (78.5559,17.3171)       2026993 182.48354	<-------
VALID   (78.4807,16.0680)       (78.5559,17.3171)       2027183 182.53635
VALID   (78.4795,16.0683)       (78.5559,17.3171)       2027425 182.60377
VALID   (78.4783,16.0685)       (78.5559,17.3171)       2027425 182.60377
VALID   (78.4722,16.0700)       (78.5559,17.3171)       2027647 182.66542
Status  FromPt  		ToPt    		Cost    Distance
VALID   (78.4819,16.0676)       (78.5559,17.3171)       2026993 182.48354	<-------
VALID   (78.4807,16.0680)       (78.5559,17.3171)       2027183 182.53635
VALID   (78.4795,16.0683)       (78.5559,17.3171)       2027425 182.60377
VALID   (78.4783,16.0685)       (78.5559,17.3171)       2027425 182.60377
VALID   (78.4722,16.0700)       (78.5559,17.3171)       2027647 182.66542

nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayPtsToPtsBuildTopNSolutions --useOnlyTitles true --yesIReallyWantToDo true
--fromlon=78.535,78.535,79.0425,79.0425 --fromlat=15.75,16.80,16.80,15.75 --tolon=78.555862 --tolat=17.317097 --topNCount 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

Status  FromPt  		ToPt    		Cost    Distance
VALID   (78.6381,16.0848)       (78.5559,17.3171)       1780869 158.43288	<-------
VALID   (78.6405,16.0840)       (78.5559,17.3171)       1781031 158.47796
VALID   (78.6428,16.0832)       (78.5559,17.3171)       1781231 158.53343
VALID   (78.6416,16.0836)       (78.5559,17.3171)       1781231 158.53343
VALID   (78.6393,16.0844)       (78.5559,17.3171)       1781246 158.53760
Status  FromPt  		ToPt    		Cost    Distance
VALID   (78.6381,16.0848)       (78.5559,17.3171)       1780869 158.43288	<-------
VALID   (78.6405,16.0840)       (78.5559,17.3171)       1781031 158.47796
VALID   (78.6428,16.0832)       (78.5559,17.3171)       1781231 158.53343
VALID   (78.6416,16.0836)       (78.5559,17.3171)       1781231 158.53343
VALID   (78.6393,16.0844)       (78.5559,17.3171)       1781246 158.53760

Top-1: nohup ${PCH_APP_HOME}/run_G2KWayToWaySolutionBuilder.sh --action wayPtsToPtsBuildTopNSolutions --useOnlyTitles true --yesIReallyWantToDo true
--fromlon=79.0425,79.0425,79.55,79.55 --fromlat=15.75,16.80,16.80,15.75 --tolon=78.555862 --tolat=17.317097 --topNCount 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-1_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=77.6505 --fromlat=16.3560 --tolon=78.5559 --tolat=17.3171 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-2_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=78.4819 --fromlat=16.0676 --tolon=78.5559 --tolat=17.3171 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-3_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=78.6381 --fromlat=16.0848 --tolon=78.5559 --tolat=17.3171 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

TOP-1: nohup ${PCH_APP_HOME}/run_G2KShortestPaths.sh --action saveRestTraversalClusterShortestPathHighOrder2 --title "Zone-4_HMWSSB_Krishna-to-Hyderabad_Route"
--fromlon=79.2533 --fromlat=16.5740 --tolon=78.5559 --tolat=17.3171 --totalNearest 5 > $PCH_LOG_HOME/nohup.out 2>&1 &

STEP9: Pre-final backup cleanup
Connect to PostGreSql container

Truncate tables:
TRUNCATE TABLE public.contraction_init;
TRUNCATE TABLE public.contraction_init_prefetch;
TRUNCATE TABLE public.node_out_shortcuts;
TRUNCATE TABLE public.node_in_shortcuts;
TRUNCATE TABLE public.node_out_shortcuts_cache;
TRUNCATE TABLE public.node_in_shortcuts_cache;
TRUNCATE TABLE public.zone_to_zone_reachability_highorder2;
TRUNCATE TABLE traversal_cluster_tmp_highorder2;

~~~~~ Take FULL DB backup ~~~~~

~~~~~ Take archive copy of the full backup to external disk ~~~~~